package map;

import java.awt.Image;
import java.awt.Toolkit;


public class Images {
	
	private final JarResources TEXTURES  = new JarResources("textures.jar");
	
	private String[] types = {"dirt","water","grass"};
	
	private Image[] textures = {Toolkit.getDefaultToolkit().createImage(
			TEXTURES.getResource ("dirt.png")),
			Toolkit.getDefaultToolkit().createImage(
			TEXTURES.getResource ("water.png")),
			Toolkit.getDefaultToolkit().createImage(
			TEXTURES.getResource ("grass.png"))};
	
	public Images() {}
	
	public Image getTexture(String type) {
		for (int i = 0; i < types.length; i++) {
			if (types[i].equals(type)) {
				return textures[i];
			}
		}
		return textures[0];
	}
	
}